Integrand size = 29, antiderivative size = 73 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=a^2 (2 A+B) x+\frac {a^2 (A+2 B) \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 (A-B) \sin (c+d x)}{d}+\frac {B \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d} \]
[Out]
Time = 0.21 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {4103, 4081, 3855} \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {a^2 (A+2 B) \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 (A-B) \sin (c+d x)}{d}+a^2 x (2 A+B)+\frac {B \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )}{d} \]
[In]
[Out]
Rule 3855
Rule 4081
Rule 4103
Rubi steps \begin{align*} \text {integral}& = \frac {B \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d}+\int \cos (c+d x) (a+a \sec (c+d x)) (a (A-B)+a (A+2 B) \sec (c+d x)) \, dx \\ & = \frac {a^2 (A-B) \sin (c+d x)}{d}+\frac {B \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d}-\int \left (-a^2 (2 A+B)-a^2 (A+2 B) \sec (c+d x)\right ) \, dx \\ & = a^2 (2 A+B) x+\frac {a^2 (A-B) \sin (c+d x)}{d}+\frac {B \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d}+\left (a^2 (A+2 B)\right ) \int \sec (c+d x) \, dx \\ & = a^2 (2 A+B) x+\frac {a^2 (A+2 B) \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 (A-B) \sin (c+d x)}{d}+\frac {B \left (a^2+a^2 \sec (c+d x)\right ) \sin (c+d x)}{d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(258\) vs. \(2(73)=146\).
Time = 2.47 (sec) , antiderivative size = 258, normalized size of antiderivative = 3.53 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {a^2 \cos ^3(c+d x) \sec ^4\left (\frac {1}{2} (c+d x)\right ) (1+\sec (c+d x))^2 (A+B \sec (c+d x)) \left ((2 A+B) x-\frac {(A+2 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {(A+2 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {A \cos (d x) \sin (c)}{d}+\frac {A \cos (c) \sin (d x)}{d}+\frac {B \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {B \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{4 (B+A \cos (c+d x))} \]
[In]
[Out]
Time = 1.52 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.21
method | result | size |
derivativedivides | \(\frac {A \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{2} \tan \left (d x +c \right )+2 A \,a^{2} \left (d x +c \right )+2 B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,a^{2} \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )}{d}\) | \(88\) |
default | \(\frac {A \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B \,a^{2} \tan \left (d x +c \right )+2 A \,a^{2} \left (d x +c \right )+2 B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,a^{2} \sin \left (d x +c \right )+B \,a^{2} \left (d x +c \right )}{d}\) | \(88\) |
parallelrisch | \(-\frac {\left (\cos \left (d x +c \right ) \left (A +2 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\cos \left (d x +c \right ) \left (A +2 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {A \sin \left (2 d x +2 c \right )}{2}-2 d \left (\frac {B}{2}+A \right ) x \cos \left (d x +c \right )-B \sin \left (d x +c \right )\right ) a^{2}}{d \cos \left (d x +c \right )}\) | \(103\) |
risch | \(2 a^{2} A x +a^{2} x B -\frac {i A \,a^{2} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i A \,a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 i B \,a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}\) | \(163\) |
norman | \(\frac {\left (2 A \,a^{2}+B \,a^{2}\right ) x +\left (-2 A \,a^{2}-B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (-2 A \,a^{2}-B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (2 A \,a^{2}+B \,a^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-\frac {4 A \,a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}+\frac {2 a^{2} \left (A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+\frac {2 a^{2} \left (A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}+\frac {a^{2} \left (A +2 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{2} \left (A +2 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(238\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.48 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {2 \, {\left (2 \, A + B\right )} a^{2} d x \cos \left (d x + c\right ) + {\left (A + 2 \, B\right )} a^{2} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (A + 2 \, B\right )} a^{2} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (A a^{2} \cos \left (d x + c\right ) + B a^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
[In]
[Out]
\[ \int \cos (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=a^{2} \left (\int A \cos {\left (c + d x \right )}\, dx + \int 2 A \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int A \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 2 B \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx\right ) \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.44 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {4 \, {\left (d x + c\right )} A a^{2} + 2 \, {\left (d x + c\right )} B a^{2} + A a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a^{2} \sin \left (d x + c\right ) + 2 \, B a^{2} \tan \left (d x + c\right )}{2 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 157 vs. \(2 (73) = 146\).
Time = 0.31 (sec) , antiderivative size = 157, normalized size of antiderivative = 2.15 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {{\left (2 \, A a^{2} + B a^{2}\right )} {\left (d x + c\right )} + {\left (A a^{2} + 2 \, B a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (A a^{2} + 2 \, B a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \]
[In]
[Out]
Time = 13.61 (sec) , antiderivative size = 161, normalized size of antiderivative = 2.21 \[ \int \cos (c+d x) (a+a \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx=\frac {A\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {4\,A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,A\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,B\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {B\,a^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \]
[In]
[Out]